package school;

public class Teacher {
    private String teacherId;
    private String teacherName;
    private String gender;
    private Course course;

    public Teacher(String teacherId, String teacherName, String gender) {
        this.teacherId = teacherId;
        this.teacherName = teacherName;
        this.gender = gender;
    }

    // 教师开课方法
    public void openCourse(Course course) {
        this.course = course;
        course.setTeacherId(this.teacherId);
        System.out.println(teacherName + " 教师开设了课程: " + course.getCourseName());
    }

    // Getter 和 Setter 方法
    public String getTeacherId() {
        return teacherId;
    }

    public void setTeacherId(String teacherId) {
        this.teacherId = teacherId;
    }

    public String getTeacherName() {
        return teacherName;
    }

    public void setTeacherName(String teacherName) {
        this.teacherName = teacherName;
    }

    public String getGender() {
        return gender;
    }

    public void setGender(String gender) {
        this.gender = gender;
    }

    public Course getCourse() {
        return course;
    }
}

